import 'dart:ui';

class AppColor {
  static Color hex(String hexColor, {double opacity = 1.0}) {
    hexColor = hexColor.toUpperCase().replaceAll("#", "");
    if (hexColor.length == 6) {
      hexColor = "FF$hexColor";
    } else {
      hexColor = "FFFFFFFF";
    }
    return Color(int.parse(hexColor, radix: 16)).withOpacity(opacity);
  }

  static const Color primary = Color(0xFF00BBFF);
  static const Color primarySecondary = Color(0xFF00FF78); // 成功/正数颜色

  static const Color textPrimary = Color(0xFFECF1FF); // 主要文本颜色

  static const Color navBgColor = Color(0xFF24262B);

  static const Color pageBgColor = Color(0xFF191B1E);
  static const Color loginBgColor = Color(0xFF08080A);

  // #08080A

  // 底部导航栏颜色 - 根据Figma设计图
  static const Color navBarBackground = Color(0xFF2C2D34); // 导航栏背景色
  static const Color navBarUnselected = Color(0x80ECEFF2); // 未选中状态颜色(50%透明度)

  static const Color color242631 = Color(0xFF242631); // 选中项背景色
  static const Color color0066FF = Color(0xFF0066FF);
  static const Color color0091FF = Color(0xFF0091FF);
  static const Color color465485 = Color(0xFF465485);
  static const Color color22242A = Color(0xFF22242A);
  static const Color color212227 = Color(0xFF212227);
  static const Color color070402 = Color(0xFF070402);
  static const Color color01FF66 = Color(0xFF01FF66);
  static const Color color2D2F35 = Color(0xFF2D2F35);
  static const Color color0F1114 = Color(0xFF0F1114);
  static const Color colorDEE3F0_26 = Color(0x26DEE3F0); //15

  static const Color btnBottomBorder = Color(0x4D000000); //30
  static const List<Color> btnSelGradient = [color0066FF, color0091FF, primary];

  static const List<Color> btnNorGradient = [
    colorDEE3F0_26,
    colorDEE3F0_26,
  ];

  // 首页设计相关颜色
  // static const Color homeBackground = Color(0xFF191B1E); // 首页背景色
  static const Color homeTabBackground = Color(0xFF2C2E34); // 首页Tab背景色

  static const Color homePrizePoolIndicator = Color(0xFF02DB7F); // 奖池指示器颜色
  static const Color homePrizePoolBgIndicator = Color(0xFF21EF89); // 奖池指示器颜色

  // static const Color gameBetOptionOddTop = Color(0xFF21CD69);
  static const Color gameBetOptionOddBottom = Color(0xFF191B1F);
  static const Color gamePlayTutorialBg = Color(0xFF16181D);

  // #16181D

  // 功能按钮渐变色
  static const List<Color> homeDepositGradient = [
    Color(0xFF27282D), // 充值按钮渐变起始色
    Color(0xFF283D35), // 充值按钮渐变结束色
  ];

  static const List<Color> homeWithdrawGradient = [
    Color(0xFF28292D), // 提现按钮渐变起始色
    Color(0xFF582E59), // 提现按钮渐变结束色
  ];

  static const List<Color> homeDownloadGradient = [
    Color(0xFF28292D), // 下载按钮渐变起始色
    Color(0xFF4F4230), // 下载按钮渐变结束色
  ];

  static const List<Color> homeCourseGradient = [
    Color(0xFF28292D), // 课程按钮渐变起始色
    Color(0xFF47396E), // 课程按钮渐变结束色
  ];

  static const Color color121417 = Color(0xFF121417);
  static const Color gameBorderColor = Color(0x26DEE3F0); // 游戏边框颜色(15%透明度)

  static const Color gameInputBg = Color(0xFF1A1C1F); // 游戏输入框背景色
  // static const Color gameSuccessColor = Color(0xFF00FF78); // 成功状态颜色
  static const Color gameErrorColor = Color(0xFFFF6B6B); // 错误状态颜色
  static const Color gameWarningColor = Color(0xFFFFB800); // 警告状态颜色
  static const Color gameResultEven = Color(0xFFED474B); // 双（偶数）结果颜色 - 红色

  static const Color dropdownBackground = Color(0xFF121315); // 下拉菜单背景色
  static const Color colorD3FA8E = Color(0xFFD3FA8E);
  static const Color colorEDA247 = Color(0xFFEDA247);

  // 安全评分渐变颜色
  static const Color safetyScoreGradientStart =
      Color(0x005B0F77); // 安全评分渐变起始色(透明紫色)
  static const Color safetyScoreGradientMid =
      Color(0xFF2A20B5); // 安全评分渐变中间色(深蓝紫色)

  // 安全评分渐变色数组
  static const List<Color> safetyScoreGradient = [
    safetyScoreGradientStart, // #5B0F7700 透明紫色
    safetyScoreGradientMid, // #2A20B5 深蓝紫色
    primary, // #00BBFF 主色蓝色
  ];

  // 安全评分背景光晕颜色
  static const Color safetyScoreGlowStart = Color(0xB3096FFC); // 蓝色70%透明度
  static const Color safetyScoreGlowEnd = Color(0x00096FFC); // 蓝色完全透明
  // #FF2D2D

  static const List<Color> gameResultWinBg = [
    Color(0x002D2D00),
    Color(0xFFFF2D2D),
    Color(0xFFFFD400),
    Color(0x00FFD400)
  ];

  static const List<Color> gameResultLoseBg = [
    Color(0x00274BFF),
    Color(0xFF274BFF),
    Color(0xFF00D4FF),
    Color(0x0000D4FF)
  ];
}
